from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait

from Driver.Driver import MDriver
from part import BarFace

class test3:
    Bar=''
    def __init__(self):
        self.Bar=BarFace.BarFace()
    # 检测功能栏元素
    def BarFace(self):
        self.Bar.Come()
        self.Bar.BarFace()
        MDriver.photo()
    # 测试搜索功能
    def BarSearch(self,name):
        self.Bar.BarSearch(name)
        WebDriverWait(MDriver.driver,3).until(expected_conditions.presence_of_element_located((By.CSS_SELECTOR,"#article_list_board_title")))
        MDriver.photo()
    # 测试夜间模式
    def BarNight(self):
        self.Bar.BarNight()
        MDriver.photo()
    # 查看消息
    def BarLookMessage(self):
        self.Bar.BarLookMessage()
    # 回复消息
    def BarReplayMessage(self,name):
        self.Bar.BarReplayMessage(name)
        MDriver.photo()
    # 关闭消息
    def BarCloseMessage(self):
        self.Bar.CloseBarMessage()
    # 分类板块
    def BarGoHome(self):
        self.Bar.BarHome()
        MDriver.photo()
    def BarGoJava(self):
        self.Bar.BarGoJava()
        MDriver.photo()
    def BarGoCpp(self):
        self.Bar.BarGoCpp()
        MDriver.photo()
    def BarGoMySQL(self):
        self.Bar.BarGoMySQL()
        MDriver.photo()

    # 进入个人帖子板块
    def BarGotoPersonalPost(self):
        self.Bar.BarHead()
        self.Bar.BarGotoPersonalPost()
        MDriver.photo()
    # 进入个人中心
    def BarGotoPersonalCenter(self):
        self.Bar.BarHead()
        self.Bar.BarGotoPersonalCenter()
        MDriver.photo()
    # 退出登录
    def BarLogOut(self):
        self.Bar.BarHead()
        self.Bar.BarLogOut()
        MDriver.photo()